Skip to content

Added MonteCarlo in Java #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 1, 2018
Merged

Conversation

DominikRafacz
Copy link
Contributor

No description provided.

@Gathros Gathros added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Jun 30, 2018
@jiegillet
Copy link
Member

jiegillet commented Jul 1, 2018

Hi @DominikRafacz, welcome to the AAA and thanks for your contribution.
My Java skills are buried too deep to be useful, but other implementations (including the original one in Julia) have moved away from using the radius parameter (you can check other Monte Carlo PR's discussions for more details).
You can drop the radius parameter from monteCarlo and always use the value 1 instead. You can leave it in inCircle if you want.

@DominikRafacz
Copy link
Contributor Author

I've just set radius of circle to 1 once and for all. Hope now it would be more appropriate ;)


Random random = new Random();

for(int i = 0; i < samples; i++){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standard Java style has parens around for and if statements: for (...) { instead of for(...){

@zsparal zsparal merged commit 0b5a6fd into algorithm-archivists:master Jul 1, 2018
@gammison gammison mentioned this pull request Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants